<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * LiteCommerce
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to licensing@litecommerce.com so we can send you a copy immediately.
 *
 * @category   LiteCommerce
 * @package    XLite
 * @subpackage Model_Proxy
 * @author     Creative Development LLC <info@cdev.ru>
 * @copyright  Copyright (c) 2011 Creative Development LLC <info@cdev.ru>. All rights reserved
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link       http://www.litecommerce.com/
 * @see        ____file_see____
 * @since      1.0.0
 */

namespace XLite\Model\Proxy;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE
 *
 * @package    XLite
 * @see        ____class_see____
 * @since      1.0.0
 */
class XLiteModelImageCategoryImageProxy extends \XLite\Model\Image\Category\Image implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * _entityClass
     *
     * @var    string
     * @access protected
     * @see    ____var_see____
     * @since  1.0.0
     */
    protected $_entityClass;

    /**
     * _entityPersister
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_entityPersister;

    /**
     * _identifier
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_identifier;

    /**
     * __isInitialized__
     *
     * @var    mixed
     * @access public
     * @see    ____var_see____
     * @since  1.0.0
     */
    public $__isInitialized__ = false;

    /**
     * __construct
     *
     * @param mixed $entityPersister ____param_comment____
     * @param mixed $identifier      ____param_comment____
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
        $this->_entityClass = 'XLite\Model\Image\Category\Image';
    }

    /**
     * _load
     *
     * @return void
     * @access private
     * @see    ____func_see____
     * @since  1.0.0
     */
    private function _load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                return;
            }
            unset($this->_entityPersister);
            unset($this->_identifier);
        }
    }

    
    public function getImageId()
    {
        $this->_load();
        return parent::getImageId();
    }

    public function setPath($path)
    {
        $this->_load();
        return parent::setPath($path);
    }

    public function getPath()
    {
        $this->_load();
        return parent::getPath();
    }

    public function setMime($mime)
    {
        $this->_load();
        return parent::setMime($mime);
    }

    public function getMime()
    {
        $this->_load();
        return parent::getMime();
    }

    public function setWidth($width)
    {
        $this->_load();
        return parent::setWidth($width);
    }

    public function getWidth()
    {
        $this->_load();
        return parent::getWidth();
    }

    public function setHeight($height)
    {
        $this->_load();
        return parent::setHeight($height);
    }

    public function getHeight()
    {
        $this->_load();
        return parent::getHeight();
    }

    public function setSize($size)
    {
        $this->_load();
        return parent::setSize($size);
    }

    public function getSize()
    {
        $this->_load();
        return parent::getSize();
    }

    public function setDate($date)
    {
        $this->_load();
        return parent::setDate($date);
    }

    public function getDate()
    {
        $this->_load();
        return parent::getDate();
    }

    public function setHash($hash)
    {
        $this->_load();
        return parent::setHash($hash);
    }

    public function getHash()
    {
        $this->_load();
        return parent::getHash();
    }

    public function setCategory(\XLite\Model\Category $category)
    {
        $this->_load();
        return parent::setCategory($category);
    }

    public function getCategory()
    {
        $this->_load();
        return parent::getCategory();
    }

    public function getBody()
    {
        $this->_load();
        return parent::getBody();
    }

    public function getExtension()
    {
        $this->_load();
        return parent::getExtension();
    }

    public function getExtensionByMIME()
    {
        $this->_load();
        return parent::getExtensionByMIME();
    }

    public function getURL()
    {
        $this->_load();
        return parent::getURL();
    }

    public function getFrontURL()
    {
        $this->_load();
        return parent::getFrontURL();
    }

    public function getResizedURL($width = NULL, $height = NULL)
    {
        $this->_load();
        return parent::getResizedURL($width, $height);
    }

    public function loadFromRequest($key, $subkey = NULL)
    {
        $this->_load();
        return parent::loadFromRequest($key, $subkey);
    }

    public function loadFromLocalFile($path, $basename = NULL)
    {
        $this->_load();
        return parent::loadFromLocalFile($path, $basename);
    }

    public function loadFromURL($url, $copy2fs = false)
    {
        $this->_load();
        return parent::loadFromURL($url, $copy2fs);
    }

    public function removeFile()
    {
        $this->_load();
        return parent::removeFile();
    }

    public function checkImageHash()
    {
        $this->_load();
        return parent::checkImageHash();
    }

    public function isURL()
    {
        $this->_load();
        return parent::isURL();
    }

    public function isExists()
    {
        $this->_load();
        return parent::isExists();
    }

    public function prepareBeforeSave()
    {
        $this->_load();
        return parent::prepareBeforeSave();
    }

    public function map(array $data)
    {
        $this->_load();
        return parent::map($data);
    }

    public function __get($name)
    {
        $this->_load();
        return parent::__get($name);
    }

    public function __set($name, $value)
    {
        $this->_load();
        return parent::__set($name, $value);
    }

    public function __unset($name)
    {
        $this->_load();
        return parent::__unset($name);
    }

    public function getRepository()
    {
        $this->_load();
        return parent::getRepository();
    }

    public function checkCache()
    {
        $this->_load();
        return parent::checkCache();
    }

    public function detach()
    {
        $this->_load();
        return parent::detach();
    }

    public function __call($method, array $args = array (
))
    {
        $this->_load();
        return parent::__call($method, $args);
    }

    public function isPersistent()
    {
        $this->_load();
        return parent::isPersistent();
    }

    public function update()
    {
        $this->_load();
        return parent::update();
    }

    public function create()
    {
        $this->_load();
        return parent::create();
    }

    public function delete()
    {
        $this->_load();
        return parent::delete();
    }

    public function cloneEntity()
    {
        $this->_load();
        return parent::cloneEntity();
    }

    public function prepareEntityBeforeCommit()
    {
        $this->_load();
        return parent::prepareEntityBeforeCommit();
    }


    /**
     * __sleep
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __sleep()
    {
        return array('__isInitialized__', 'category', 'image_id', 'path', 'mime', 'width', 'height', 'size', 'date', 'hash');
    }

    /**
     * __wakeup
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __wakeup()
    {
        if (isset($this->_identifier)) {
            foreach ($this->_identifier as $k => $v) {
                $this->$k = $v;
            }

            \Xlite\Core\Database::getEM()->getUnitOfWork()->removeFromIdentityMap($this);
            $this->_entityPersister = \XLite\Core\Database::getEM()->getUnitOfWork()->getEntityPersister($this->_entityClass);
        }
    }
}